<?php
/**
 * Created by 2019/4/12 0012
 * Effect: RedisKey.php
 * Author: 品花
 * Date: 2019/4/12 0012
 * Time: 上午 10:01
 */

namespace Consts;


class RedisKey
{
    //短信验证码缓存时间
    const LOGIN_PHONE_CODE_TIMEOUT = 960 ;
    //登录会话超时
    const LOGIN_SESSION_OUTTIME  = 864000;
    //用户token
    const LOGIN_USER_TOKEN = 'login_user_token:%s';
    //客服信息缓存
    const ADMIN_SERVICE_INFO_LIST = 'admin_service_info_list';
    //用户权限列表
    const USER_AUTHORITY_LIST = 'USER_AUTHORITY_LIST:%s';
    //平台列表
    const KF_PLATFORM_LIST = "kf_platform_list";
    //当前WS类型
    const FD_ROLE = "fd_role";
    //在线客服
    const platform_online_service = "online_service:platform%s:problem%s";
    //客服ws和auid绑定
    const WS_SERVICE_FD_TO_AUID = "ws_service_fd_to_auid";
    const WS_SERVICE_AUID_TO_FD = "ws_service_auid_to_fd";
    //用户ws和uid绑定
    const WS_CUSTOMER_FD_TO_UID = "ws_customer_fd_to_uid";
    const WS_CUSTOMER_UID_TO_FD = "ws_customer_uid_to_fd";

    //客服的在线会话客户列表
    const ONLINE_CUSTOMER_LIST = "online_customer_list:auid%s";

    //客服接待队列
    const SERVICE_QUEUE_LIST = "service_queue_list:%s";
    const CUSTOMER_BIND_SERVICE = "customer_bind_service";

    //客户现在的会话时IP地址
    const CUSTOMER_NOW_SESS_IP = "customer_now_sess_ip";

    //登陆用户的token
    static function loginUserToken($uid){

        return sprintf(self::LOGIN_USER_TOKEN,$uid);
    }

    static function online_customer_list($auid){

        return sprintf(self::ONLINE_CUSTOMER_LIST,$auid);
    }

    static function service_queue_list($auid){
        return sprintf(self::SERVICE_QUEUE_LIST,$auid);
    }

    static function user_authority_list($uid){
        return sprintf(self::USER_AUTHORITY_LIST,$uid);
    }

    //在线客服
    static function platform_online_service($platform_id ,$problem_id){

        return sprintf(self::platform_online_service,$platform_id,$problem_id);
    }


}